-
Notifications
You must be signed in to change notification settings - Fork 38
Add—time-format option support for dmesg
#160
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
9e4781a to
7dc7924
Compare
|
@cakebaker can I support I'll delete |
|
It's ok to keep them in this PR, they are part of the |
Co-authored-by: Daniel Hofstetter <[email protected]>
src/uu/dmesg/src/time_formatter.rs
Outdated
| let sub_seconds = i64::abs(delta_us % 1000000); | ||
| let sign = if delta_us >= 0 { '+' } else { '-' }; | ||
| let mut res = format!("{}.{:0>6}", seconds, sub_seconds); | ||
| res.insert(0, sign); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the reason for using insert to add the sign instead of doing it on line 77?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yes, I could've added it on line 77 for this case. I changed it in commit e965074.
Just curious, your comment regarding this is concerning readability, correct? Or are you also concerned about the string processing performance?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it is about readability. I don't know whether there is much of a difference in string processing performance.
Co-authored-by: Daniel Hofstetter <[email protected]>
|
Thanks, good job :) |
Continuation of PR #152 for issue #14 : support
—time-formatoption.